# groups.cmake

# group Source Group 1
add_library(Group_Source_Group_1 OBJECT
  "${SOLUTION_ROOT}/main.c"
  "${SOLUTION_ROOT}/../base.c"
)
target_include_directories(Group_Source_Group_1 PUBLIC
  $<TARGET_PROPERTY:${CONTEXT},INTERFACE_INCLUDE_DIRECTORIES>
)
target_compile_definitions(Group_Source_Group_1 PUBLIC
  $<TARGET_PROPERTY:${CONTEXT},INTERFACE_COMPILE_DEFINITIONS>
)
add_library(Group_Source_Group_1_ABSTRACTIONS INTERFACE)
target_link_libraries(Group_Source_Group_1_ABSTRACTIONS INTERFACE
  ${CONTEXT}_ABSTRACTIONS
)
target_compile_options(Group_Source_Group_1 PUBLIC
  $<TARGET_PROPERTY:${CONTEXT},INTERFACE_COMPILE_OPTIONS>
)
target_link_libraries(Group_Source_Group_1 PUBLIC
  Group_Source_Group_1_ABSTRACTIONS
)

# group rtthread
add_library(Group_rtthread OBJECT
  "${SOLUTION_ROOT}/rtthread/libcpu/arm/cortex-m4/context_gcc.S"
  "${SOLUTION_ROOT}/rtthread/src/clock.c"
  "${SOLUTION_ROOT}/rtthread/src/components.c"
  "${SOLUTION_ROOT}/rtthread/src/cpu.c"
  "${SOLUTION_ROOT}/rtthread/src/device.c"
  "${SOLUTION_ROOT}/rtthread/src/idle.c"
  "${SOLUTION_ROOT}/rtthread/src/ipc.c"
  "${SOLUTION_ROOT}/rtthread/src/irq.c"
  "${SOLUTION_ROOT}/rtthread/src/kservice.c"
  "${SOLUTION_ROOT}/rtthread/src/mem.c"
  "${SOLUTION_ROOT}/rtthread/src/memheap.c"
  "${SOLUTION_ROOT}/rtthread/src/mempool.c"
  "${SOLUTION_ROOT}/rtthread/src/object.c"
  "${SOLUTION_ROOT}/rtthread/src/scheduler.c"
  "${SOLUTION_ROOT}/rtthread/src/signal.c"
  "${SOLUTION_ROOT}/rtthread/src/slab.c"
  "${SOLUTION_ROOT}/rtthread/src/thread.c"
  "${SOLUTION_ROOT}/rtthread/src/timer.c"
  "${SOLUTION_ROOT}/rtthread/libcpu/arm/cortex-m4/cpuport.c"
  "${SOLUTION_ROOT}/rtthread/components/finsh/cmd.c"
  "${SOLUTION_ROOT}/rtthread/components/finsh/msh_file.c"
  "${SOLUTION_ROOT}/rtthread/components/finsh/msh_parse.c"
  "${SOLUTION_ROOT}/rtthread/components/finsh/msh.c"
  "${SOLUTION_ROOT}/rtthread/components/finsh/shell.c"
  "${SOLUTION_ROOT}/rtthread/bsp/board.c"
)
target_include_directories(Group_rtthread PUBLIC
  $<TARGET_PROPERTY:${CONTEXT},INTERFACE_INCLUDE_DIRECTORIES>
  "${SOLUTION_ROOT}/rtthread/components/finsh"
)
target_compile_definitions(Group_rtthread PUBLIC
  $<TARGET_PROPERTY:${CONTEXT},INTERFACE_COMPILE_DEFINITIONS>
)
add_library(Group_rtthread_ABSTRACTIONS INTERFACE)
target_link_libraries(Group_rtthread_ABSTRACTIONS INTERFACE
  ${CONTEXT}_ABSTRACTIONS
)
target_compile_options(Group_rtthread PUBLIC
  $<TARGET_PROPERTY:${CONTEXT},INTERFACE_COMPILE_OPTIONS>
)
target_link_libraries(Group_rtthread PUBLIC
  Group_rtthread_ABSTRACTIONS
)
set_source_files_properties("${SOLUTION_ROOT}/rtthread/libcpu/arm/cortex-m4/context_gcc.S" PROPERTIES
  COMPILE_DEFINITIONS "GD32F470;_RTE_"
)
